<!DOCTYPE html>
<html lang="en" xmlns="http://www.w3.org/1999/xhtml" xmlns:th="http://www.thymeleaf.org"
      xmlns:sec="http://www.thymeleaf.org/thymeleaf-extras-springsecurity3">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <link rel="stylesheet" th:href="@{/css/app.css}">
    <link rel="stylesheet" th:href="@{/css/iconfont.css}">
    <link rel="stylesheet" th:href="@{/css/table.css}">
    <title>Blog</title>
</head>
<body>
    <div class="headBar">
        <div class="headBar-items">
            <div class="headBar-item">
                <a th:href="@{/user/{uid}/addBlog(uid=${user.id})}">上传博客</a>
            </div>
            <div class="headBar-item">
                <a th:href="@{/user/{uid}/blogs(uid=${user.id})}">所有博客</a>
            </div>
        </div>
    </div>
    <div class="content">
        <div class="content-data">
            <table class="pure-table pure-table-horizontal">
                <thead>
                    <tr>
                        <th>title</th>
                        <th>blogAbstract</th>
                        <th>releaseTime</th>
                        <th>browse</th>
                        <th>good</th>
                        <th>bad</th>
                        <th>message</th>
                        <th>options</th>
                    </tr>
                </thead>
                <tbody>
                    <tr th:each="blog:${blogs}">
                        <td th:text="${blog.title}"></td>
                        <td th:text="${blog.blogAbstract}"></td>
                        <td th:text="${blog.releaseTime}"></td>
                        <td th:text="${blog.browse}"></td>
                        <td th:text="${blog.good}"></td>
                        <td th:text="${blog.bad}"></td>
                        <td th:text="${blog.message}"></td>
                        <td>
                            <a th:href="@{'/user/'+${user.id}+'/updateBlog?bid='+${blog.id}}">update</a>
                            <a th:href="@{'/user/'+${user.id}+'/blog/'+${blog.id}+'/delete'}">delete</a>
<!--                            <a th:if="${!blog.top}" th:href="@{'/user/'+${user.id}+'/blog/'+${blog.id}+'/top'}">top</a>-->
<!--                            <a th:if="${blog.top}" th:href="@{'/user/'+${user.id}+'/blog/'+${blog.id}+'/unTop'}">unTop</a>-->
                        </td>
                    </tr>
                </tbody>
            </table>
        </div>
    </div>
</body>
</html>